<template>
  <div class="app-container">
    <div
      v-show="
        !modifyInfo.visible &&
        !detailInfo.visible &&
        !purchAppDetailinfo.visible &&
        !summaryDetailInfo.visible &&
        !detailListInfo.visible
      "
    >
      <!-- 条件栏 -->
      <div class="filter-wrapper">
        <new-page-filter
          v-model:query="filterInfo.query.queryMap"
          :query-more-json="true"
          :filter-list="filterInfo.searchList"
          :filter-btn="filterInfo.searchBtn"
          :clear-type="clearType"
          :slipSelectRequest="slipSelectRequest"
        >
        </new-page-filter>
        <el-button @click="detailListInfo.visible = true">明细页</el-button>
      </div>
      <div class="filter-wrapper">
        <new-page-filter :filter-btn="filterInfo.btnList">
          <template v-slot:filter-doPurch>
            <el-button
              :disabled="!canDoPurch"
              @click="handelMethodRequest(undefined, 'doPurch')"
              >采购
            </el-button>
          </template>
          <template v-slot:filter-merge>
            <el-button
              :disabled="!canMerge"
              @click="handelMethodRequest(undefined, 'merge')"
              >合单
            </el-button>
          </template>
          <template v-slot:filter-revoke>
            <el-button
              :disabled="!canRevoke"
              @click="handelMethodRequest(undefined, 'revoke')"
              >撤回
            </el-button>
          </template>
          <template v-slot:filter-ratify>
            <el-button
              :disabled="!canRatify"
              @click="handelMethodRequest(undefined, 'ratify')"
              >批准
            </el-button>
          </template>
          <template v-slot:filter-break>
            <el-button
              :disabled="!canBreak"
              @click="handelMethodRequest(undefined, 'break')"
              >中止
            </el-button>
          </template>
          <template v-slot:filter-submit>
            <el-button
              :disabled="!canSubmit"
              @click="handelMethodRequest(undefined, 'submit')"
              >提交
            </el-button>
          </template>
        </new-page-filter>
        <div class="display-flex">
          <el-button @click="preferenceInfo.visible = true">偏好设置</el-button>
        </div>
      </div>
      <!-- 表格 -->
      <TableContainer
        ref="TableContainer"
        :refresh="tableInfo.refresh"
        :init-curpage="tableInfo.initCurpage"
        v-model:data="tableInfo.data"
        :api="tableInfo.api"
        :query="filterInfo.query"
        :field-list="tableInfo.fieldList"
        :handle="tableInfo.handle"
        :row-class-name="tableRowClassName"
        @handleEvent="handleEvent"
      >
        <template v-slot:col-orderNo="scope">
          <span
            v-if="$permission('purchOrder:detail')"
            class="slip-edit"
            @click="showDetail(scope.row)"
            >{{ scope.row.orderNo || '-' }}</span
          >
          <span v-else>{{ scope.row.orderNo || '-' }}</span>
        </template>
        <template v-slot:col-applicationNo="scope">
          <span
            v-if="$permission('purchApplication:detail')"
            class="slip-edit"
            @click="showPurchAppDetail(scope.row)"
            >{{ scope.row.applicationNo || '-' }}</span
          >
          <span v-else>{{ scope.row.applicationNo || '-' }}</span>
        </template>
      </TableContainer>
    </div>
    <!-- 新增或修改 -->
    <PurchOrderModify
      v-if="modifyInfo.visible"
      v-model:visible="modifyInfo.visible"
      :title="modifyInfo.title"
      :orderId="modifyInfo.orderId"
      :tableKey="modifyInfo.tableKey"
      :purchAccording="modifyInfo.purchAccording"
      @returnModify="returnModify"
    />
    <PurchOrderDetail
      v-if="detailInfo.visible"
      v-model:visible="detailInfo.visible"
      :orderId="detailInfo.orderId"
      @returnBack="getList"
    />
    <PurchApplicationDetail
      v-if="purchAppDetailinfo.visible"
      v-model:visible="purchAppDetailinfo.visible"
      :table-row="purchAppDetailinfo.data"
      @returnBack="getList"
    />
    <PurchApplicationSummaryDetail
      v-if="summaryDetailInfo.visible"
      v-model:visible="summaryDetailInfo.visible"
      :table-row="summaryDetailInfo.data"
      @returnBack="getList"
    />
    <SetPreference
      v-if="preferenceInfo.visible"
      v-model:visible="preferenceInfo.visible"
      :search-list="filterInfo.searchList"
      :field-list="tableInfo.fieldList"
      :customize-user-v-o="filterInfo.query.customizeUserVO"
      :group-level-show="false"
      @callback="setPreferenceCallback"
    />
    <AdvancedSearch
      v-if="advancedSearchInfo.visible"
      v-model:visible="advancedSearchInfo.visible"
      v-model:form-data="advancedSearchInfo.data"
      :field-list="tableInfo.fieldList"
      @callback="advancedSearchCallback"
    />
    <detailList
      v-if="detailListInfo.visible"
      v-model:visible="detailListInfo.visible"
      @callback="getList"
    ></detailList>
    <page-dialog
      v-if="pageDialogInfo.visible"
      :title="pageDialogInfo.title"
      v-model:visible="pageDialogInfo.visible"
      :width="pageDialogInfo.width"
      :bt-loading="pageDialogInfo.btLoading"
      :bt-list="pageDialogInfo.btList"
      @reset="closeDialog"
    >
      <page-form
        class="paddingBox order-model-formBox flex_wrap_start_start"
        v-model:ref-obj="pageFormInfo.ref"
        :data="pageFormInfo.data"
        :field-list="pageFormInfo.fieldList"
        :label-width="pageFormInfo.labelWidth"
      />
    </page-dialog>
  </div>
</template>

<script setup name="purchDemo">
import {
  getPurchOrderCustomizeListPage,
  methodPurchOrder,
  removePurchOrder,
} from '@/api/purch'
import { getSupplierAll, getCoreSystemConfigGetConfigValue } from '@/api/core'
import { getCustomizeSetting, updateUserCustomize } from '@/api/customize'
import PurchOrderModify from './modify'
import PurchOrderDetail from './detail'
import PurchApplicationDetail from '../application/detail'
import PurchApplicationSummaryDetail from '@/views/purch/applicationSummary/detail'

const detailList = defineAsyncComponent(() => import('./detailList'))

const { proxy } = getCurrentInstance()

const listTypeInfo = ref({
  supplierList: [],
  typeList: [],
})
const filterInfo = ref({
  sortArr: [],
  copyQueryMap: {},
  query: {
    sortString: '',
    customizeUserVO: {},
    queryMap: {
      purchProductType: {
        asTbName: 'purch_order',
        columnName: 'purch_product_type',
        queryType: 'EQUALS',
        queryCategory: 'AND',
        value: '1',
      },
      deptAuth: {
        asTbName: 'purch_order',
        columnName: 'dept_id',
        queryType: 'IN',
        queryCategory: 'AND',
        value: 'deptAuth',
      },
      supplierAuth: {
        asTbName: 'purch_order',
        columnName: 'supplier_id',
        queryType: 'IN',
        queryCategory: 'AND',
        value: 'supplierAuth',
      },
    },
  },
  searchList: [],
  btnList: [
    {
      type: 'button',
      label: '新增',
      event: create,
      show: proxy.$permission('purchOrder:add'),
    },
    {
      type: 'slot',
      value: 'break',
      show: proxy.$permission('purchOrder:break'),
    },
    {
      type: 'slot',
      value: 'merge',
      show: proxy.$permission('purchOrder:merge'),
    },
    {
      type: 'slot',
      value: 'doPurch',
      show: proxy.$permission('purchOrder:doPurch'),
    },
    {
      type: 'slot',
      value: 'ratify',
      show: proxy.$permission('purchOrder:ratify'),
    },
    {
      type: 'slot',
      value: 'submit',
      show: proxy.$permission('purchOrder:submit'),
    },
    {
      type: 'slot',
      value: 'revoke',
      show: proxy.$permission('purchOrder:revoke'),
    },
  ],
  searchBtn: [
    { type: 'button', label: '搜索', event: _search },
    { type: 'button', label: '高级查询', event: _advancedSearchShow },
    { type: 'button', label: '重置', event: _clearSearch },
  ],
})
// 表格相关
const tableInfo = ref({
  refresh: 1,
  initCurpage: 1,
  data: [],
  selections: [],
  fieldList: [],
  handle: {
    fixed: 'right',
    label: '操作',
    width: '100',
    btList: [
      {
        label: '修改',
        event: update,
        show: proxy.$permission('purchOrder:update'),
        ifRender: function (row) {
          return row.status === 1
        },
      },
      {
        label: '提交',
        event: (row) => handelMethodRequest(row, 'submit'),
        show: proxy.$permission('purchOrder:submit'),
        ifRender: function (row) {
          return row.status === 1
        },
      },
      {
        label: '中止',
        event: (row) => handelMethodRequest(row, 'stop'),
        show: proxy.$permission('purchOrder:stop'),
        ifRender: ifRenderStop,
      },
      {
        label: '采购',
        event: (row) => handelMethodRequest(row, 'doPurch'),
        show: proxy.$permission('purchOrder:doPurch'),
        ifRender: function (row) {
          return row.status === 3
        },
      },
      {
        label: '撤回',
        event: (row) => handelMethodRequest(row, 'revoke'),
        show: proxy.$permission('purchOrder:revoke'),
        ifRender: ifRenderRevoke,
      },
      {
        label: '批准',
        event: (row) => handelMethodRequest(row, 'ratify'),
        show: proxy.$permission('purchOrder:ratify'),
        ifRender: function (row) {
          return row.status === 2
        },
      },
      {
        label: '驳回',
        event: (row) => handelMethodRequest(row, 'reject'),
        show: proxy.$permission('purchOrder:reject'),
        ifRender: function (row) {
          return row.status === 2
        },
      },
      {
        label: '拆单',
        event: (row) => handelMethodRequest(row, 'split'),
        show: proxy.$permission('purchOrder:split'),
        ifRender: function (row) {
          return (
            (row.status === 1 || row.status === 2 || row.status === 3) &&
            row.mergedOrders.length > 0 &&
            row.status === row.beforeMergeStatus
          )
        },
      },
      {
        label: '删除',
        event: remove,
        show: proxy.$permission('purchOrder:delete'),
        ifRender: function (row) {
          return row.status === 1
        },
      },
    ],
  },
})
//明细相关
const detailInfo = ref({
  visible: false,
  orderId: '',
})
const purchAppDetailinfo = ref({
  visible: false,
  title: '申购单明细',
  data: {},
})
const summaryDetailInfo = ref({
  visible: false,
  title: '申购单汇总明细',
  data: {},
})
//新增或更新相关
const modifyInfo = ref({
  visible: false,
  title: '',
  orderId: '',
  tableKey: '',
  purchAccording: '',
})
const licencesSystemConfig = ref('')
const tableKey = ref('purchOrderList-com.slip.spd.entity.vo.purch.PurchOrderVO')
const pageDialogInfo = ref({
  title: '选择采购依据',
  visible: false,
  type: '',
  width: '400px',
  row: {},
  btLoading: false,
  btList: [
    {
      label: '关闭',
      type: '',
      icon: '',
      event: closeDialog,
      show: true,
    },
    {
      label: '保存',
      type: 'primary',
      icon: '',
      event: saveDialog,
      saveLoading: false,
      show: true,
    },
  ],
})
const pageFormInfo = ref({
  ref: null,
  data: {},
  fieldList: [
    {
      label: '采购依据',
      value: 'purch_according',
      type: 'select-model',
      code: 'purch_according',
    },
  ],
})
const lastReceiveTime = ref(null)
const purchTime = ref(null)

const canSubmit = computed(() => {
  return (
    tableInfo.value.selections.filter((item) => item.status === 1).length !==
      0 &&
    tableInfo.value.selections.filter((item) => item.status !== 1).length === 0
  )
})
const canRatify = computed(() => {
  return (
    tableInfo.value.selections.filter((item) => item.status === 2).length !== 0
  )
})
const canRevoke = computed(() => {
  return (
    tableInfo.value.selections.filter(
      (item) =>
        item.status === 2 ||
        (item.status === 3 &&
          proxy.$store.state.permission.systemConfig
            .allow_purch_order_approval != 1)
    ).length !== 0 &&
    tableInfo.value.selections.filter(
      (item) => item.status !== 2 && item.status !== 3
    ).length === 0
  )
})
// 不同状态不能合单
const canMerge = computed(() => {
  let status = tableInfo.value.selections.map((item) => item.status)
  let setStatus = []
  if (status != null) {
    setStatus = Array.from(new Set(status))
  }
  return (
    tableInfo.value.selections.filter(
      (item) => item.status === 1 || item.status === 2 || item.status === 3
    ).length !== 0 &&
    tableInfo.value.selections.filter(
      (item) => item.status !== 1 && item.status !== 2 && item.status !== 3
    ).length === 0 &&
    setStatus.length === 1 &&
    tableInfo.value.selections.length > 1
  )
})
const canDoPurch = computed(() => {
  let status = tableInfo.value.selections.map((item) => item.status)
  let setStatus = []
  if (status != null) {
    setStatus = Array.from(new Set(status))
  }
  return (
    tableInfo.value.selections.filter((item) => item.status === 3).length !==
      0 &&
    tableInfo.value.selections.filter((item) => item.status !== 3).length ===
      0 &&
    setStatus.length === 1 &&
    tableInfo.value.selections.length >= 1
  )
})
const canBreak = computed(() => {
  return (
    tableInfo.value.selections.filter(
      (item) =>
        (item.status === 3 &&
          proxy.$store.state.permission.systemConfig
            .allow_purch_order_approval === 1) ||
        item.status === 13 ||
        item.status === 14
    ).length !== 0
  )
})
const toPage = computed(() => {
  return proxy.$store.state.settings.toPage
})

watch(
  () => filterInfo.value.query.lastReceiveTimeGreater,
  (val) => {
    if (!val) {
      lastReceiveTime.value = null
    }
  }
)
watch(
  () => filterInfo.value.query.purchTimeGreater,
  (val) => {
    if (!val) {
      purchTime.value = null
    }
  }
)
let stopWatch = function () {}
onActivated(() => {
  stopWatch = watch(
    () => toPage.value,
    (val) => {
      if (val) {
        let menus = proxy.$store.state.permission.defaultMenus
        menus.forEach((item) => {
          if (item.children) {
            item.children.forEach((el) => {
              if (el.code === 'purchOrder' && el.url === val.url) {
                detailInfo.value.visible = false
                modifyInfo.value.visible = false
                detailInfo.value.visible = false
                if (val.urlType === 1) {
                  getList()
                } else if (val.urlType === 2) {
                  proxy.$nextTick(() => {
                    detailInfo.value.visible = true
                    detailInfo.value.orderId = val.businessId
                    sessionStorage.setItem('storeRowId', val.businessId)
                  })
                }
                proxy.$store.dispatch('settings/toPage', '')
              }
            })
          }
        })
      }
    },
    {
      deep: true,
      immediate: true,
    }
  )
})
onDeactivated(() => {
  stopWatch()
})

onMounted(() => {
  let list = proxy.$store.state.permission.dict['purch_order_status']
  if (list != undefined && list != null && list.length > 0) {
    listTypeInfo.value.typeList = list.map((item) => {
      return {
        value: item.code,
        key: item.name,
      }
    })
  }
  getValueList()
})

setData()
function setData() {
  let obj = {
    mergeTypeValue: {
      label: '合并状态',
      value: 'mergeTypeValue',
      asValue: 'mergeType',
      componentType: 'select-model',
      code: 'merge_type',
      show: false,
      hidden: true,
    },
    beforeMergeStatusValue: {
      label: '合并前状态值',
      value: 'beforeMergeStatusValue',
      asValue: 'beforeMergeStatus',
      componentType: 'select-model',
      code: 'purch_order_status',
      show: false,
      hidden: true,
    },
    statusValue: {
      label: '状态',
      value: 'statusValue',
      asValue: 'status',
      componentType: 'select-model',
      code: 'purch_order_status',
      show: false,
      hidden: true,
    },
  }
  tableInfo.value.fieldList = Object.values({
    ...proxy.$fn.deepClone(proxy.$fieldfList.FieldList),
    ...proxy.$fn.deepClone(obj),
  })
  filterInfo.value.searchList = Object.values({
    ...proxy.$fn.deepClone(proxy.$fieldfList.FieldList),
    ...proxy.$fn.deepClone(obj),
  })
  getCustomize()
}
function _search() {
  search()
}
function _advancedSearchShow() {
  advancedSearchShow()
}
function _clearSearch() {
  clearSearch()
}
const detailListInfo = ref({
  visible: false,
})
const preferenceInfo = ref({
  visible: false,
})
const advancedSearchInfo = ref({
  visible: false,
  data: {},
})
const clearType = ref(true)
const slipSelectRequest = ref(true)
function setPreferenceCallback(obj) {
  updateUserCustomize(obj.customizeUserVO).then((res) => {
    if (res && res.success) {
      getCustomize(!slipSelectRequest.value)
    }
  })
}
function advancedSearchShow() {
  advancedSearchInfo.value.visible = true
}
// 获取列表
async function getList() {
  tableInfo.value.refresh = Math.random()
}
// 搜索
function search() {
  // 重置分页
  advancedSearchInfo.value.data = {}
  filterInfo.value.query.queryDtoList = []
  tableInfo.value.initCurpage = Math.random()
  tableInfo.value.refresh = Math.random()
}
function clearSearch() {
  clearType.value = !clearType.value
  advancedSearchInfo.value.data = {}
  filterInfo.value.query.queryMap = proxy.$fn.deepClone(
    filterInfo.value.copyQueryMap
  )
  search()
}
// 触发事件
function handleEvent(event, data) {
  switch (event) {
    case 'tableCheck':
      tableInfo.value.selections = [...data]
      break
  }
}
function tableRowClassName({ row }) {
  let rowId = sessionStorage.getItem('storeRowId')
  if (rowId && row.id === Number(rowId)) {
    return 'check-row'
  }
  if (
    (row.status === 13 ||
      row.status === 14 ||
      row.status === 15 ||
      row.status === 16) &&
    dataTimeCompare(row.expectDeliveryTime)
  ) {
    return 'warning-row'
  }
  return ''
}
function dataTimeCompare(date) {
  let data = new Date(date)
  let currData = new Date()
  return currData > data
}
function ifRenderStop(row) {
  return (
    (row.status === 3 &&
      proxy.$store.state.permission.systemConfig.allow_purch_order_approval ===
        1) ||
    row.status === 13 ||
    row.status === 14
  )
}
function ifRenderRevoke(row) {
  return (
    row.status === 2 ||
    (row.status === 3 &&
      proxy.$store.state.permission.systemConfig.allow_purch_order_approval !=
        1)
  )
}
function lastReceiveTimeChange(val) {
  if (val && val.length) {
    filterInfo.value.query.queryMap.lastReceiveTime.value = `${val[0]},${val[1]}`
  } else {
    filterInfo.value.query.queryMap.lastReceiveTime.value = ''
  }
}
function purchTimeChange(val) {
  if (val && val.length) {
    filterInfo.value.query.queryMap.purchTime.value = `${val[0]},${val[1]}`
  } else {
    filterInfo.value.query.queryMap.purchTime.value = ''
  }
}
function initSupplierSelect() {
  const params = {
    supplierAuth: 'supplierId',
  }
  getSupplierAll(params).then((resp) => {
    if (resp && resp.success) {
      listTypeInfo.value.supplierList = resp.data.map((item) => {
        return {
          key: item.supplierName,
          value: item.supplierId,
        }
      })
    }
  })
}
function returnModify() {
  if (modifyInfo.value.orderId) {
    getList()
  } else {
    search()
  }
}
function closeDialog() {
  pageDialogInfo.value.visible = false
  pageFormInfo.value.data = {}
}
function saveDialog() {
  if (pageFormInfo.value.data.purch_according) {
    modifyInfo.value.title = '新增采购单'
    modifyInfo.value.purchReturnId = ''
    modifyInfo.value.purchAccording = pageFormInfo.value.data.purch_according
    modifyInfo.value.orderId = ''
    modifyInfo.value.tableKey =
      'purchOrderDetailModify-com.slip.spd.entity.vo.purch.PurchOrderDetailVO'
    closeDialog()
    proxy.$nextTick(() => {
      modifyInfo.value.visible = true
    })
  } else {
    proxy.$message.warning('请选择采购依据')
  }
}
// 创建
function create() {
  if (
    proxy.$store.state.permission.systemConfig.purch_according != '1' &&
    proxy.$store.state.permission.systemConfig.purch_according != '2'
  ) {
    pageDialogInfo.value.visible = true
  } else {
    modifyInfo.value.visible = true
    modifyInfo.value.title = '新增采购单'
    modifyInfo.value.orderId = ''
    modifyInfo.value.purchAccording =
      proxy.$store.state.permission.systemConfig.purch_according
    modifyInfo.value.tableKey =
      'purchOrderDetailModify-com.slip.spd.entity.vo.purch.PurchOrderDetailVO'
  }
}
// 编辑
function update(data) {
  sessionStorage.setItem('storeRowId', data.id)
  modifyInfo.value.visible = true
  modifyInfo.value.purchAccording = data.purchAccording
  modifyInfo.value.title = '修改采购单'
  // 显示信息
  modifyInfo.value.orderId = data.id
  if (data.purchType === 0 || data.purchType === 1) {
    modifyInfo.value.tableKey =
      'purchOrderDetailModifyByApplication-com.slip.spd.entity.vo.purch.PurchOrderDetailVO'
  } else {
    modifyInfo.value.tableKey =
      'purchOrderDetailModify-com.slip.spd.entity.vo.purch.PurchOrderDetailVO'
  }
}
//删除
function remove(row) {
  const data = []
  data.push(row.id)
  proxy.$handleAPI('delete', removePurchOrder, data).then((resp) => {
    if (resp && resp.success) {
      getList()
    }
  })
}
//展示明细
function showDetail(row) {
  sessionStorage.setItem('storeRowId', row.id)
  detailInfo.value.orderId = row.id
  detailInfo.value.visible = true
}
function showPurchAppDetail(row) {
  let obj = {}
  sessionStorage.setItem('storeRowId', row.id)
  obj = JSON.parse(JSON.stringify(row))
  obj.id = row.applicationId
  let purchType = row.purchType
  if (purchType === 0) {
    purchAppDetailinfo.value.visible = true
    purchAppDetailinfo.value.data = { ...obj }
  } else if (purchType === 1) {
    summaryDetailInfo.value.visible = true
    summaryDetailInfo.value.data = { ...obj }
  }
}
async function advancedSearchCallback(obj) {
  console.log(123)
  let _filterInfo = filterInfo.value
  _filterInfo.query.queryMap = {}
  let arr = [
    {
      fieldName: 'deptId',
      queryType: 'IN',
      queryCategory: 'AND',
      value: 'deptAuth',
    },
  ]
  _filterInfo.query.queryDtoList = [...obj.queryDtoList, ...arr]
  advancedSearchInfo.value.data = obj.data
  await getList()
  clearType.value = !clearType.value
  _filterInfo.query.queryMap = proxy.$fn.deepClone(_filterInfo.copyQueryMap)
}
function handelMethodRequest(row = undefined, method) {
  const ids = getIds(row)
  if (method === 'reject') {
    proxy
      .$prompt('请输入驳回理由', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        inputValidator: proxy.$fn.maxString200,
        inputErrorMessage: '驳回理由不能超过200字符',
      })
      .then(({ value }) => {
        const data = {
          id: row.id,
          rejectReason: value,
        }
        methodPurchOrder(data, method).then((resp) => {
          if (resp && resp.success) {
            getList()
          }
        })
      })
  } else {
    methodPurchOrder(ids, method).then((resp) => {
      if (resp.success) {
        tableInfo.value.refresh = Math.random()
      }
    })
  }
}
function getIds(row = undefined) {
  let ids = []
  if (row) {
    ids.push(row.id)
  } else {
    ids = tableInfo.value.selections.map((row) => row.id)
  }
  return ids
}
//收货
function getValueList() {
  getCoreSystemConfigGetConfigValue({
    systemConfigCode: 'purch_order_expire',
  }).then((resp) => {
    if (resp && resp.success) {
      licencesSystemConfig.value = resp.data
    }
  })
}
function getCustomize(_slipSelectRequest = true) {
  let _tableInfo = tableInfo.value
  let _filterInfo = filterInfo.value
  let param = {
    tableKey: tableKey.value,
  }
  getCustomizeSetting(param).then((res) => {
    if (res && res.success) {
      let data = res.data
      filterInfo.value.query.customizeUserVO = data
      _tableInfo.fieldList = proxy.$fn.setFieldList(
        _tableInfo.fieldList,
        data.detail
      )
      console.log(_tableInfo.fieldList)
      let searchInfo = proxy.$fn.setSearchList(
        _filterInfo.searchList,
        data.detail
      )
      _filterInfo.query.queryMap = {
        ...searchInfo.queryMap,
        ..._filterInfo.query.queryMap,
      }
      _filterInfo.searchList = searchInfo.searchList
      _filterInfo.searchList.forEach((item) => {
        item.event = search
      })
      filterInfo.value.copyQueryMap = proxy.$fn.deepClone(
        filterInfo.value.query.queryMap
      )
      slipSelectRequest.value = _slipSelectRequest
      _tableInfo.api = getPurchOrderCustomizeListPage
      getList()
    }
  })
}
</script>

<style scoped lang="scss"></style>
